package com.swt.gap.config;

import com.swt.gap.common.constant.CommonConstant;
import com.swt.gap.common.constant.UrlConstant;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zqw
 * @date 2020/5/18 9:34
 */
@Configuration
public class MvcConfiguration implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        registry.addResourceHandler(UrlConstant.UPLOAD_MEDIA_URL + "**").addResourceLocations("file:" + CommonConstant.UPLOAD_DIR);
        registry.addResourceHandler(UrlConstant.RESULT_URL + "**").addResourceLocations("file:" + CommonConstant.RESULT_PIC);
        registry.addResourceHandler(UrlConstant.ICON_URL + "**").addResourceLocations("file:" + CommonConstant.ICON_PATH);
    }
}


